<template>
  <header class="search-header" @tap="e => $emit('tap', e)" :style="{backgroundColor: bgc}">
    <div class="inner">
      <i class="material-icons" v-if="icon">{{ icon }}</i>
      <span>{{ text }}</span>
    </div>
  </header>
</template>

<script>
export default {
  props: {
    icon: { type: String, default: 'search' },
    text: { type: String, default: '搜索' },
    bgc: { type: String, default: 'green' }
  }
}
</script>

<style scoped>
.search-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25rpx;
}
.inner {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8rpx;
  background-color: #fff;
  flex: auto;
  font-size: 24rpx;
  color: #999;
  padding: 8rpx;
}
i.material-icons {
  font-size: 36rpx;
}
</style>

